package com.venutech.gongan.common;

/**
 * 视频监控类型
 */
public enum MonitorType {

    FIRST_CLASS(1, "一类视频监控点"),
    SECOND_CLASS(2, "二类视频监控点"),
    THIRD_CLASS(3, "三类视频监控点"),
    POLICE_INTERNAL(4, "公安内部视频监控点"),
    OTHERS(9, "其他视频监控点");

    private int value;
    private String typeName;

    MonitorType(int value, String typeName) {
        this.typeName = typeName;
        this.value = value;
    }

    public static String getNameByValue(int value) {
        for (MonitorType item : MonitorType.values()) {
            if (item.getValue() == value) {
                return item.getTypeName();
            }
        }
        return "";
    }

    public static MonitorType getUserTypeByValue(int value) {
        MonitorType userType = MonitorType.FIRST_CLASS;
        if (value == MonitorType.FIRST_CLASS.getValue()) {
            userType = MonitorType.FIRST_CLASS;
        } else if (value == MonitorType.SECOND_CLASS.getValue()) {
            userType = MonitorType.SECOND_CLASS;
        } else if (value == MonitorType.THIRD_CLASS.getValue()) {
            userType = MonitorType.THIRD_CLASS;
        } else if(value == MonitorType.POLICE_INTERNAL.getValue()) {
            userType = MonitorType.POLICE_INTERNAL;
        } else if(value == MonitorType.OTHERS.getValue()) {
            userType = MonitorType.OTHERS;
        }

        return userType;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
}
